Current Location: Home> Function Categories> cos

cos

Cosine
Name:cos
Category:math
Programming Language:php
One-line Description:Cosine.

Definition and usage

cos() function returns the cosine of a number.

Example

In this case, we will calculate the cosines of different values:

 <?php
echo ( cos ( 3 ) ) ;
echo ( cos ( - 3 ) ) ;
echo ( cos ( 0 ) ) ;
echo ( cos ( M_PI ) ) ;
echo ( cos ( 2 * M_PI ) ) ;
?>

Try it yourself

grammar

 cos ( x )
parameter describe
x Required. A number.

illustrate

cos() returns the cosine value of the parameter x . The unit of parameter x is radians.

Similar Functions
  • Calculate the index of e exp

    exp

    Calculatetheindexofe
  • Returns exp(number) - 1, and can calculate the exact result even when the value of number is close to zero. expm1

    expm1

    Returnsexp(number)-1
  • Convert binary to decimal bindec

    bindec

    Convertbinarytodecim
  • Convert angle to radians deg2rad

    deg2rad

    Convertangletoradian
  • Round the division result intdiv

    intdiv

    Roundthedivisionresu
  • Absolute value abs

    abs

    Absolutevalue
  • Convert decimal to octal decoct

    decoct

    Convertdecimaltoocta
  • Leave the method of sorting floor

    floor

    Leavethemethodofsort
Popular Articles